package com.ruoyi.js.service.impl;

import java.util.List;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.js.mapper.JsPlayerMapper;
import com.ruoyi.js.domain.JsPlayer;
import com.ruoyi.js.service.IJsPlayerService;
import com.ruoyi.common.core.text.Convert;

/**
 * 选手Service业务层处理
 * 
 * @author greejoy
 * @date 2024-04-22
 */
@Service
public class JsPlayerServiceImpl implements IJsPlayerService 
{
    @Autowired
    private JsPlayerMapper jsPlayerMapper;

    /**
     * 查询选手
     * 
     * @param id 选手ID
     * @return 选手
     */
    @Override
    public JsPlayer selectJsPlayerById(Long id)
    {
        return jsPlayerMapper.selectJsPlayerById(id);
    }

    /**
     * 查询选手列表
     * 
     * @param jsPlayer 选手
     * @return 选手
     */
    @Override
    public List<JsPlayer> selectJsPlayerList(JsPlayer jsPlayer)
    {
        return jsPlayerMapper.selectJsPlayerList(jsPlayer);
    }

    /**
     * 新增选手
     * 
     * @param jsPlayer 选手
     * @return 结果
     */
    @Override
    public int insertJsPlayer(JsPlayer jsPlayer)
    {
        jsPlayer.setCreateBy(ShiroUtils.getLoginName());
        jsPlayer.setCreateTime(DateUtils.getNowDate());
        return jsPlayerMapper.insertJsPlayer(jsPlayer);
    }

    /**
     * 修改选手
     * 
     * @param jsPlayer 选手
     * @return 结果
     */
    @Override
    public int updateJsPlayer(JsPlayer jsPlayer)
    {
        jsPlayer.setUpdateBy(ShiroUtils.getLoginName());
        jsPlayer.setUpdateTime(DateUtils.getNowDate());
        return jsPlayerMapper.updateJsPlayer(jsPlayer);
    }

    /**
     * 删除选手对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteJsPlayerByIds(String ids)
    {
        return jsPlayerMapper.deleteJsPlayerByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除选手信息
     * 
     * @param id 选手ID
     * @return 结果
     */
    @Override
    public int deleteJsPlayerById(Long id)
    {
        return jsPlayerMapper.deleteJsPlayerById(id);
    }

    @Override
    public List<JsPlayer> selectJsPlayerListByIds(String ids)
    {
        return jsPlayerMapper.selectJsPlayerListByIds(Convert.toStrArray(ids));
    }

    @Override
    public JsPlayer selectJsPlayerByIdcard(String idcard)
    {
        return jsPlayerMapper.selectJsPlayerByIdcard(idcard);
    }

}
